<template>
  <div class="hello">
    <h1>{{ count }}</h1>
    <ctrl></ctrl>
  </div>
</template>

<script>
import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

import ctrl from './ctrl'

import {mapState} from 'vuex'
export default {
  name: 'hello',
  computed: {
    /*count () {
      return this.$store.state.count
    }*/
    ...mapState(['count'])
  },
  /*computed: mapState({
    //count: state => state.count,
    //count: 'count',//state.count
    count (state) {
      return state.count
    }
  }),*/
  components: {
    ctrl
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
